home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 1.toast / Sample Code / Contributed / SpriteWorld / SpriteWorld Files / MPW / SpriteWorldUtils.make < prev    next >
Encoding:
Text File  |  2000-10-06  |  6.1 KB  |  222 lines  |  [TEXT/R*ch]

  1. #-----------------------------------------------------------------------
  2. #    Makefile for MPW (Macintosh Programmers Workshop by Apple)
  3. #
  4. #   Project:    SpriteWorldUtils
  5. #   File:       SpriteWorldUtils.make
  6. #
  7. #    Targets:    All (default), Debug, Final
  8. #                 Clean (remove objects), Clean-All (remove binaries)
  9. #                
  10. #    Written by Anders F Björklund <afb@algonet.se>
  11. #-----------------------------------------------------------------------
  12.  
  13. Makefile          = "SpriteWorldUtils.make"    # high-level make (this file)
  14. MakeOutput          = "SpriteWorldUtils.makelow"# low-level make (built by this file)
  15.  
  16. SpriteWorldUtils ƒ All                        # Default High-Level Target
  17. All                 ƒ Debug Final
  18. Final              ƒ 68K.Final PPC.Final
  19. Debug              ƒ 68K.Debug PPC.Debug
  20. Clean             ƒ Clean.Debug Clean.Final
  21. Clean-All         ƒ Clean-All.Debug Clean-All.Final
  22.  
  23. #----------------------------------------------------
  24.  
  25. Tgt                =    #
  26. Opt                =    #
  27. Sym                =    #
  28. Dbg                =    #
  29. Mbg                =    #
  30.  
  31. Common =         -f {Makefile}
  32.                 
  33. Debug =         -d    Tgt=Debug ∂
  34.                 -d    Opt=off ∂
  35.                 -d    Sym=on ∂
  36.                 -d    Dbg=Debug
  37.             
  38. Final =         -d    Tgt=Final ∂
  39.                 -d    Opt=speed ∂
  40.                 -d    Sym=off ∂
  41.                 -d    Dbg=
  42.  
  43. Debug68K =        {Common} {Debug} -d Mbg="-mbg on"
  44. DebugPPC =        {Common} {Debug} -d Mbg="-tb on"
  45. Final68K =        {Common} {Final} -d Mbg="-mbg off"
  46. FinalPPC =        {Common} {Final} -d Mbg=""
  47.  
  48. #----------------------------------------------------
  49. # The high-level targets
  50. #----------------------------------------------------
  51.  
  52. 68K.Debug         ƒ    $OutOfDate
  53.     Make -d Binary=68K {Debug68K} 68K >{MakeOutput}
  54.     Execute {MakeOutput}
  55.     Delete {MakeOutput}
  56.     
  57. PPC.Debug         ƒ    $OutOfDate
  58.     Make -d Binary=PPC {DebugPPC} PPC >{MakeOutput}
  59.     Execute {MakeOutput}
  60.     Delete {MakeOutput}
  61.     
  62. 68K.Final         ƒ    $OutOfDate
  63.     Make -d Binary=68K {Final68K} 68K >{MakeOutput}
  64.     Execute {MakeOutput}
  65.     Delete {MakeOutput}
  66.     
  67. PPC.Final         ƒ    $OutOfDate
  68.     Make -d Binary=PPC {FinalPPC} PPC >{MakeOutput}
  69.     Execute {MakeOutput}
  70.     Delete {MakeOutput}
  71.  
  72. Clean.Debug     ƒ    $OutOfDate
  73.     Make {Common} {Debug} Remove >{MakeOutput}
  74.     Execute {MakeOutput}
  75.     Delete {MakeOutput}
  76.  
  77. Clean.Final     ƒ    $OutOfDate
  78.     Make {Common} {Final} Remove >{MakeOutput}
  79.     Execute {MakeOutput}
  80.     Delete {MakeOutput}
  81.  
  82. Clean-All.Debug ƒ    $OutOfDate
  83.     Make {Common} {Debug} Remove-All >{MakeOutput}
  84.     Execute {MakeOutput}
  85.     Delete {MakeOutput}
  86.  
  87. Clean-All.Final ƒ    $OutOfDate
  88.     Make {Common} {Final} Remove-All >{MakeOutput}
  89.     Execute {MakeOutput}
  90.     Delete {MakeOutput}
  91.  
  92. #-----------------------------------------------------------------------
  93. # Project Variables
  94. #-----------------------------------------------------------------------
  95.  
  96. Objects            =    :{Dbg}Objects:
  97.  
  98. Sources         =    "{SpriteWorld}Utils:"
  99. Headers         =    "{SpriteWorld}Utils:"
  100.  
  101. ExtraSources    =    "{SpriteWorld}Utils:Brian's Extensions:"
  102. ExtraHeaders    =    "{SpriteWorld}Utils:Brian's Extensions:"
  103.  
  104. SWHeaders         =    "{SpriteWorld}Headers:"
  105. SWLibs             =    "{SpriteWorld}Libraries:"
  106.  
  107. LibName68K        =    SpriteWorld{Dbg}Utils.o
  108. LibNamePPC        =    SpriteWorld{Dbg}Utils.x
  109.  
  110. Lib68K          =    {SWLibs}{LibName68K}
  111. LibPPC          =    {SWLibs}{LibNamePPC}
  112.  
  113. 68K                 ƒ    {Lib68K}
  114. PPC                ƒ    {LibPPC}
  115.  
  116. #-----------------------------------------------------------------------
  117. # Compiler options
  118. #-----------------------------------------------------------------------
  119.  
  120. CC68K             =    {C}            # normally SC
  121. CCPPC            =    {PPCC}        # normally MrC
  122. LINK68K         =    Lib
  123. LINKPPC         =    PPCLink
  124.  
  125. Options            =
  126. Warnings        =    -proto strict -typecheck strict  
  127. IncludesFolders    =    -i {Headers} -i {ExtraHeaders} -i {SWHeaders}
  128.  
  129. CCOptions       =    {IncludesFolders} {Options} {Warnings} -opt {Opt} 
  130. CCOptions68K    =     {CCOptions} {Mbg} -model far
  131. CCOptionsPPC    =     {CCOptions} {Mbg}
  132.  
  133. LibOptions     =     -sym {Sym}
  134. LibOptions68K   =     {LibOptions}
  135. LibOptionsPPC    =     {LibOptions} -xm l
  136.  
  137. #-----------------------------------------------------------------------
  138. # These are the sources that we want to include in the library.
  139. #-----------------------------------------------------------------------
  140.  
  141. Objects68k        =    ∂
  142.         {Objects}'Circular Scrolling'.c.o ∂
  143.         {Objects}'Multi-Screen Scrolling'.c.o ∂
  144.         {Objects}SWApplication.c.o ∂
  145.         {Objects}SWCompressResource.c.o ∂
  146.         {Objects}SWDialogUtils.c.o ∂
  147.         {Objects}SWDitherDown.c.o ∂
  148.         {Objects}SWFastLine.c.o ∂
  149.         {Objects}SWFastLine.a.o ∂
  150.         {Objects}SWFixed.c.o ∂
  151.         {Objects}SWFPSReport.c.o ∂
  152.         {Objects}SWGameUtils.c.o ∂
  153.         {Objects}SWParticles.c.o ∂
  154.         {Objects}SWSounds.c.o ∂
  155.         {Objects}SWStats.c.o ∂
  156.         {Objects}BlitPixieRotated.c.o ∂
  157.         {Objects}BlitPixieScaled.c.o ∂
  158.         {Objects}SWLightingSquares.c.o ∂
  159.         {Objects}SWTinting.c.o ∂
  160.         {Objects}SWTranslucentBlitters.c.o
  161.     
  162. ObjectsPPC    =    ∂
  163.         {Objects}'Circular Scrolling'.c.x ∂
  164.         {Objects}'Multi-Screen Scrolling'.c.x ∂
  165.         {Objects}SWApplication.c.x ∂
  166.         {Objects}SWCompressResource.c.x ∂
  167.         {Objects}SWDialogUtils.c.x ∂
  168.         {Objects}SWDitherDown.c.x ∂
  169.         {Objects}SWFastLine.c.x ∂
  170.         {Objects}SWFixed.c.x ∂
  171.         {Objects}SWFPSReport.c.x ∂
  172.         {Objects}SWGameUtils.c.x ∂
  173.         {Objects}SWParticles.c.x ∂
  174.         {Objects}SWSounds.c.x ∂
  175.         {Objects}SWStats.c.x ∂
  176.         {Objects}BlitPixieRotated.c.x ∂
  177.         {Objects}BlitPixieScaled.c.x ∂
  178.         {Objects}SWLightingSquares.c.x ∂
  179.         {Objects}SWTinting.c.x ∂
  180.         {Objects}SWTranslucentBlitters.c.x
  181.  
  182. #-----------------------------------------------------------------------
  183. # These are modified default build rules.  
  184. #-----------------------------------------------------------------------
  185.  
  186. {Objects}        ƒ    {Sources}
  187. {Objects}        ƒ    {ExtraSources}
  188.  
  189. .a.o            ƒ    .a
  190.     Echo "# Compiling {Default}.a using Asm"
  191.     Asm {DepDir}{Default}.a -o {TargDir}{Default}.a.o
  192.  
  193. .c.o            ƒ    .c
  194.     Echo "# Compiling {Default}.c using {CC68K} ({Tgt})"
  195.     {CC68K} {CCOptions68K} {DepDir}{Default}.c -o {TargDir}{Default}.c.o
  196.  
  197. .c.x            ƒ    .c
  198.     Echo "# Compiling {Default}.c using {CCPPC} ({Tgt})"
  199.     {CCPPC} {CCOptionsPPC} {DepDir}{Default}.c -o {TargDir}{Default}.c.x
  200.  
  201. #-----------------------------------------------------------------------
  202. # The low-level output targets.  
  203. #-----------------------------------------------------------------------
  204.  
  205. {Lib68K}        ƒƒ    {Objects68K}
  206.     Echo "# Linking 680X0 library {LibName68K}"
  207.     {LINK68K} {LibOptions68K} {Objects68K} -o {Lib68K} 
  208.  
  209. {LibPPC}        ƒƒ    {ObjectsPPC}
  210.     Echo "# Linking PowerPC library {LibNamePPC}"
  211.     {LINKPPC} {LibOptionsPPC} {ObjectsPPC} -o {LibPPC} 
  212.  
  213. Remove            ƒ
  214.     Echo "# Removing {Tgt} objects"
  215.     Delete -i {Objects68K} {ObjectsPPC}
  216.  
  217. Remove-All        ƒ Remove
  218.     Echo "# Removing {Tgt} binaries"
  219.     Delete -i {Lib68K} {LibPPC}
  220.  
  221.  
  222.